import materialTypeApi from '@/api/processing-management/basic-info-manage/material-type-manage/index';

export const mymixin = {
  data() {
    return {
      options: []
    };
  },
  mounted() {
    this.treeTransform();
  },
  methods: {
    treeTransform() {
      materialTypeApi.conditionUnifyQuery({}).then(res => {
        if (res.code === 1) {
          let list = [];
          // 提供表头搜索数据
          res.data.content.forEach(item => {
            list.push({
              name: item.materialName,
              typeName: item.materialTypeName,
              value: item.materialNo,
              typeNo: item.materialTypeNo
            });
          });
          this.options = list;
        }
      });
    }
  }
};
